/*
 * Copyright (C) 2011, EADS France
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */

package xowl.generator;

/**
 *
 * @author Laurent WOUTERS
 */
public class InstanceGenerator {
    private ClassGenerator _class;
    private xowl.lang.runtime.NamedIndividual oWLInstance;
    private String name;
    private String iri;

    public ClassGenerator getType() { return _class; }
    public xowl.lang.runtime.NamedIndividual getOWLInstance() { return oWLInstance; }
    public String getName() { return name; }
    public String getIRI() { return iri; }

    public InstanceGenerator(ClassGenerator c, xowl.lang.runtime.NamedIndividual instance) {
        this._class = c;
        this.oWLInstance = instance;
        this.iri = this.oWLInstance.getInterpretationOf().getHasIRI().getHasValue();
        String[] parts = iri.split("#");
        this.name = parts[parts.length-1];
    }

    public void writeJava(java.io.Writer writer, GenerationMode mode) throws java.io.IOException { }
}
